package com.sgcc.activiti.service.impl;

import java.util.List;
import com.sgcc.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sgcc.activiti.mapper.OInterfaceIndexMapper;
import com.sgcc.activiti.domain.OInterfaceIndex;
import com.sgcc.activiti.service.IOInterfaceIndexService;

/**
 * 接口维护Service业务层处理
 * 
 * @author sgcc
 * @date 2021-04-01
 */
@Service
public class OInterfaceIndexServiceImpl implements IOInterfaceIndexService 
{
    @Autowired
    private OInterfaceIndexMapper oInterfaceIndexMapper;

    /**
     * 查询接口维护
     * 
     * @param id 接口维护ID
     * @return 接口维护
     */
    @Override
    public OInterfaceIndex selectOInterfaceIndexById(Long id)
    {
        return oInterfaceIndexMapper.selectOInterfaceIndexById(id);
    }

    /**
     * 查询接口维护列表
     * 
     * @param oInterfaceIndex 接口维护
     * @return 接口维护
     */
    @Override
    public List<OInterfaceIndex> selectOInterfaceIndexList(OInterfaceIndex oInterfaceIndex)
    {
        return oInterfaceIndexMapper.selectOInterfaceIndexList(oInterfaceIndex);
    }

    /**
     * 新增接口维护
     * 
     * @param oInterfaceIndex 接口维护
     * @return 结果
     */
    @Override
    public int insertOInterfaceIndex(OInterfaceIndex oInterfaceIndex)
    {
        oInterfaceIndex.setCreateTime(DateUtils.getNowDate());
        return oInterfaceIndexMapper.insertOInterfaceIndex(oInterfaceIndex);
    }

    /**
     * 修改接口维护
     * 
     * @param oInterfaceIndex 接口维护
     * @return 结果
     */
    @Override
    public int updateOInterfaceIndex(OInterfaceIndex oInterfaceIndex)
    {
        oInterfaceIndex.setUpdateTime(DateUtils.getNowDate());
        return oInterfaceIndexMapper.updateOInterfaceIndex(oInterfaceIndex);
    }

    /**
     * 批量删除接口维护
     * 
     * @param ids 需要删除的接口维护ID
     * @return 结果
     */
    @Override
    public int deleteOInterfaceIndexByIds(Long[] ids)
    {
        return oInterfaceIndexMapper.deleteOInterfaceIndexByIds(ids);
    }

    /**
     * 删除接口维护信息
     * 
     * @param id 接口维护ID
     * @return 结果
     */
    @Override
    public int deleteOInterfaceIndexById(Long id)
    {
        return oInterfaceIndexMapper.deleteOInterfaceIndexById(id);
    }

    @Override
    public OInterfaceIndex selectAddressbycode(String code) {
        return oInterfaceIndexMapper.selectAddressbycode(code);
    }
}
